<? 
/*
*   this view receives:
*   $list['controller']
*   $list['items'] = array ($id, $title, $text, $image)
* 
*/


              
$i=1;
foreach($items as $item) 
{

        $trim_length = 200-strlen($item['title']);
        if ($trim_length <= 40) $trim_length = 40;
        $item['text'] = trim_string(strip_tags($item['text']), $trim_length, "...");

        $u=uniqid('');// unique id for each row, for javascript ids

?>            

    <? if (is_int(($i+2)/3)){ ?><div class="summarycontainer"><? } ?> 

    <div class="contain<? if (is_int($i/3)) echo 'right'?>">

        <? if (isset($item["image"])) { ?>
            <a href="<?=site_url($controller.$item['id'])?>"><img height="66" border="0" width="106" alt="" src="<?=thumbnail(base_url().UPLOADS_FOLDER.PRODUCT_IMG_FOLDER.$item["image"])?>"/></a>
        <? } ?>

        <? if (isset($item["date"])) { ?>
            <p class="date"><?=format_date($item["date"])?></p>
        <? } ?>

        <p>
          <strong>
            <a href="<?=site_url($controller.$item['id'])?>">
              <?=$item['title']?>
            </a>
          </strong>
        </p>


        <p>
          <?=$item['text']?>
          <a class="more" href="<?=site_url($controller.$item['id'])?>">more..</a>
        </p>

        <p>---</p>
        <p> </p>
        <div class="iconscontain">
        <table cellspacing="0" cellpadding="0" border="0">
          <tbody><tr>
            <td>
                <a href="<?=site_url('wishlist/overlay_move_product/'.$item['id'].'/'.$item['id_Wishlists'])?>" rel="overlay">
                    <img height="18" width="28" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('move<?=$u?>','','<?=base_url()?>assets/website/images/buttons<?=INSTANCE_FILE_SUFFIX ?>/wishlist-move_f2.gif','blank<?=$u?>','','<?=base_url()?>assets/website/images/buttons<?=INSTANCE_FILE_SUFFIX ?>/wishlist-move_txt.gif',1)" id="move<?=$u?>" name="move<?=$u?>" alt="move to another list" src="<?=base_url()?>assets/website/images/buttons<?=INSTANCE_FILE_SUFFIX ?>/wishlist-move.gif" />
                </a>
            </td>
            <td>
                <a href="<?=site_url('products/pdf/'.$item['id'])?>">
                    <img height="18" width="22" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('downloadtearsheet<?=$u?>','','<?=base_url()?>assets/website/images/buttons<?=INSTANCE_FILE_SUFFIX ?>/wishlist-download_f2.gif','blank<?=$u?>','','<?=base_url()?>assets/website/images/buttons<?=INSTANCE_FILE_SUFFIX ?>/wishlist-download_txt.gif',1)" id="downloadtearsheet<?=$u?>" name="downloadtearsheet<?=$u?>" alt="download tearsheet" src="<?=base_url()?>assets/website/images/buttons<?=INSTANCE_FILE_SUFFIX ?>/wishlist-download.gif" />
                </a>
            </td>
            <td>
                <a rel="overlay" href="<?=site_url('wishlist/overlay_remove_product/'.$item['id'].'/'.$item['id_Wishlists'])?>" rel="overlay">
                    <img height="18" width="22" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('deletefromwishlist<?=$u?>','','<?=base_url()?>assets/website/images/buttons<?=INSTANCE_FILE_SUFFIX ?>/wishlist-delete_f2.gif','blank<?=$u?>','','<?=base_url()?>assets/website/images/buttons<?=INSTANCE_FILE_SUFFIX ?>/wishlist-delete_txt.gif',1)" id="deletefromwishlist<?=$u?>" name="deletefromwishlist<?=$u?>" alt="delete from wish list" src="<?=base_url()?>assets/website/images/buttons<?=INSTANCE_FILE_SUFFIX ?>/wishlist-delete.gif" />
                </a>
            </td>
            <td>
                <label>
                <input type="checkbox" value="<?=$item['id']?>" name="product_checkbox" class="checkbox">
                </label>
            </td>
            <td>&nbsp; enquire</td>
          </tr>
          <tr>
            <td colspan="5"><img height="18" width="118" id="blank<?=$u?>" name="blank<?=$u?>" alt="blank" src="<?=base_url()?>assets/website/images/buttons<?=INSTANCE_FILE_SUFFIX ?>/wishlist-blank_txt.gif" /></td>
            </tr>

        </tbody></table>

        <form id="remove_form_<?=$u?>" action="" method="post">
        <input type="hidden" name="wishlist_action" value="remove_product">
        <input type="hidden" name="from_wishlist_id" value="<?=$params?>">
        <input type="hidden" name="product_id" value="<?=$item['id']?>">
        </form>

        </div>

    </div>       

    <? if ( (is_int($i/3)) || ($i==count($items)) ){ ?></div><? } ?> 

<? 
    $i++;
}
	

	
	if (empty($items)){
?>

    <div class="summarycontainer">
        <p><?=$this->lang->line('WishlistEmpty');?></p>
    </div>

<?

    } 

?>  
